﻿using System.Diagnostics;
using System.IO;

namespace EzDeploy.Core
{
    public class DirectoryBrowser : IDirectoryBrowser
    {
        public void Browse(string path)
        {
            if (string.IsNullOrEmpty(path)) 
                return;

            string ext = Path.GetExtension(path);

            if (!string.IsNullOrEmpty(ext))
                path = Path.GetDirectoryName(path);

            if (Directory.Exists(path))
                Process.Start(path);
        }
    }
}